package cn.kami.dao.proxy;

import java.util.List;

import cn.kami.dao.IManufacturerDAO;
import cn.kami.dao.impl.ManufacturerDAOImpl;
import cn.kami.dbc.DatabaseConnection;
import cn.kami.factory.DatabaseConnectionFactory;
import cn.kami.vo.Manufacturer;

public class ManufacturerDAOProxy implements IManufacturerDAO {
	private DatabaseConnection dbc = null;
	private ManufacturerDAOImpl dao = null;
	public ManufacturerDAOProxy()throws Exception{
		this.dbc = DatabaseConnectionFactory.getOracleDatabaseConnection();
		this.dao = new ManufacturerDAOImpl(this.dbc.getConnection());
	}
	@Override
	public List<Manufacturer> findAll(String keyWord) throws Exception {
		// TODO Auto-generated method stub
		List<Manufacturer> all = null;
		try{
			all = this.dao.findAll(keyWord);
		}catch(Exception e){
			throw e;
		}finally{
			this.dbc.close();
		}
		return all;
	}

}
